package org.zhangsh.netty.handler;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.string.StringDecoder;

import java.nio.charset.Charset;
import java.util.List;

/**
 * </p>
 *
 * @author zhangshuhui
 * @version 1.0.0
 * @since 2019/8/21
 */
@ChannelHandler.Sharable
public class NewStringDecoder extends StringDecoder {
    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception {

        System.out.println("NewStringDecoder... " + msg.toString(Charset.defaultCharset()));

        super.decode(ctx, msg, out);
    }
}
